#include <stdio.h>

int main(int argc, char *argv[]) {

    int n = 0;
    scanf("%d", &n);
    for (size_t i = 0; i < n; i++)
    {
        int k, z;
        scanf("%d %d", &k, &z);

        int g = 0, s = 0, sum = 0;
        

        if(k>=100){
            g = k % 10;
            s = k / 10 % 10;
            sum += s * 10 + g;
        }else{
            sum += k;
        }

        if(z>=100){
            g = z % 10;
            s = z / 10 % 10;
            sum += s * 10 + g;
        }else{
            sum += z;
        }
        
        if(sum>=100){
            g = sum % 10;
            s = sum / 10 % 10;
            sum = s * 10 + g;
            printf("%d\n", sum);
        }else{
            printf("%d\n", sum);
        }
        

    }
    
    return 0;
}